package jiang;

public class YieldTest2 implements Runnable {
    public static void main(String[] args) {
        YieldTest2 y = new YieldTest2();
        Thread.currentThread().setPriority(10);
        Thread t = new Thread(y);
        t.setPriority(5);
        t.start();
        while (Thread.activeCount() > 1) {
            Thread.yield();
        }
    }

    @Override
    public void run() {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        // TODO Auto-generated method stub
        System.out.println(123);
    }
}
